﻿using SD.Infrastructure.RepositoryBase;
using SlamDunk.MES.Domain.Entities.ResourceContext;
using System;
using System.Collections.Generic;

namespace SlamDunk.MES.Domain.IRepositories.Interfaces.ResourceContext
{
    /// <summary>
    /// 班组仓储接口
    /// </summary>
    public interface ITeamRepository : IAggRootRepository<Team>
    {
        #region # 分页获取班组列表 —— ICollection<Team> FindByPage(string keywords...
        /// <summary>
        /// 分页获取班组列表
        /// </summary>
        /// <param name="keywords">关键字</param>
        /// <param name="facilityIds">工厂模型Id集</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">页容量</param>
        /// <param name="rowCount">总记录数</param>
        /// <param name="pageCount">总页数</param>
        /// <returns>班组列表</returns>
        ICollection<Team> FindByPage(string keywords, IList<Guid> facilityIds, int pageIndex, int pageSize, out int rowCount, out int pageCount);
        #endregion

        #region # 根据人员获取唯一班组 —— Team SingleOrDefaultByPerson(Guid personId)
        /// <summary>
        /// 根据人员获取唯一班组
        /// </summary>
        /// <param name="personId">人员Id</param>
        /// <returns>班组</returns>
        Team SingleOrDefaultByPerson(Guid personId);
        #endregion

        #region # 是否存在人员 —— bool ExistPerson(Guid personId)
        /// <summary>
        /// 是否存在人员
        /// </summary>
        /// <param name="personId">人员Id</param>
        /// <returns>是否存在</returns>
        bool ExistPerson(Guid personId);
        #endregion
    }
}
